import request from '../request'
import requestUrl from '../requestUrl'
import requestParam from '../requestParam'

// 获取列表
export function getOverview () {
  return request({
    url: requestUrl('overview/index'),
    method: 'get',
    params: requestParam({}, 'get')
  })
}

// 获取验证码
export function captcha (uuid) {
  return requestUrl(`/captcha.jpg?uuid=${uuid}`)
}

// 富文本组件编辑器
export function ueditor () {
  return requestUrl(`/ueditor/config`)
}
// 文件上传写入附件
export function upload () {
  return requestUrl(`/upload`)
}
// 文件上传不写入福建
export function uploadurl () {
  return requestUrl(`/upload_url`)
}
// 文件ftp上传
export function uploadftpurl () {
  return requestUrl(`/upload_ftp`)
}
// 文件ftp上传
export function uploadlocal () {
  return requestUrl(`/upload_local`)
}
// 登录
export function login (params) {
  return request({
    url: requestUrl('/sys/login'),
    method: 'post',
    data: requestParam(params)
  })
}
// 退出
export function logout () {
  return request({
    url: requestUrl('/sys/logout'),
    method: 'post',
    data: requestParam()
  })
}

// 获取注册验证码
export function createVcode (params) {
  return request({
    url: requestUrl('/sys/create_vcode'),
    method: 'get',
    params: requestParam(params, 'get')
  })
}
// 注册
export function register (params) {
  return request({
    url: requestUrl('/sys/register'),
    method: 'post',
    data: requestParam(params)
  })
}
